#include "CL_MainWindow.h"

CL_MainWindow::CL_MainWindow(QWidget *parent)
	: QMainWindow(parent)
{
	
}

CL_MainWindow::~CL_MainWindow()
{

}

void CL_MainWindow::initialize()
{
	QList<CL_Widget*> allCLWidget = findChildren<CL_Widget*>();
	Q_FOREACH(CL_Widget* child, allCLWidget)
	{
		QObject::connect(child, SIGNAL(updatedSignal(CL_UpdatedContext*)), this, SLOT(childUpdated(CL_UpdatedContext*)));
		QObject::connect(this, SIGNAL(childUpdatedSignal(CL_UpdatedContext*)), child, SLOT(updated(CL_UpdatedContext*)));
	}
}

void CL_MainWindow::childUpdated(CL_UpdatedContext* context) 
{
	Q_EMIT childUpdatedSignal(context);
}
